package com.zhekou.web.listener;

import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * User: chjp
 * Date: 11-11-22
 * Time: 下午5:50
 */
public class StartListener implements ServletContextListener {
    public static ApplicationContext context;

    public void contextInitialized(ServletContextEvent event) {
        try {
            ServletContext application = event.getServletContext();
            context = WebApplicationContextUtils.getWebApplicationContext(application);
        } catch (Throwable e) {
            e.printStackTrace();
        }


    }

    public void contextDestroyed(ServletContextEvent event) {
    }
}
